#ifndef IMAGE_FEATURE_MANAGER_H_
#define IMAGE_FEATURE_MANAGER_H_

#include "ZMLAlgorithm.h"
#include "../Common/ZSingleton.h"
#include <map>

GLOBAL_NAMESPACE_BEGIN

namespace ImageSpace
{
    class Image;
}

namespace MLAlgorithms
{
    class ImageFeature;
}

class ImageFeatureManager : public Singleton<ImageFeatureManager>
{
public:
    typedef std::map<ImageSpace::Image*, MLAlgorithms::ImageFeature*> FeatureContainer;
    typedef FeatureContainer::iterator FeatureIterator;

public:
    ImageFeatureManager();
    ~ImageFeatureManager();

    void init();
    void destroy();

    //MLAlgorithms::ImageFeature* createFeature(ImageSpace::Image* ima);
    MLAlgorithms::ImageFeature* addFeature(MLAlgorithms::ImageFeature* feature);

    MLAlgorithms::ImageFeature* getFeature(ImageSpace::Image* ima);
    int getFeatureCount();
    int getFeatureDim();
    FeatureIterator featureBeginIterator();
    FeatureIterator featureEndIterator();

private:
    FeatureContainer features_;

    bool bDimCompatible_;
    int  nFeatureDim_;
};

GLOBAL_NAMESPACE_END

#endif//IMAGE_FEATURE_MANAGER_H_